package com.xjoyt.pay.master.repository;

import java.util.ArrayList;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import com.xjoyt.pay.master.dao.DistributorRateRepositoryCustom;
import com.xjoyt.pay.master.po.DistributorRate;
import com.xjoyt.pay.repository.Repository;
import com.xjoyt.pay.vo.PayType;

public interface DistributorRateRepository extends Repository<DistributorRate>, DistributorRateRepositoryCustom {

	Page<DistributorRate> findAllByDistributorIdAndType(String distributorId, PayType type, Pageable pageable);

	@Query(" select a from DistributorRate a where a.distributor.id in ?1 ")
	ArrayList<DistributorRate> findAllByDistributorIdIn(List<String> ids);

	@Query(" select a from DistributorRate a where a.distributor.id = ?1 ")
	List<DistributorRate> findAllByDistributorId(String id);

}
